{extend name="public/layout" /}
{block name="link"}
<link rel="stylesheet" href="__STATIC__/frame/layui/css/layui.css">
<link rel="stylesheet" href="__STATIC__/frame/static/css/style.css">
{/block}
{block name="main"}

<!-- 为 ECharts 准备一个具备大小（宽高）的 DOM -->
<div id="main-line" style="width: 100%;height:400px;"></div>

<div id="main-bing" style="width: 100%;height:400px;"></div>
{/block}
{block name="footer"}
<script type="text/javascript" src="__STATIC__/frame/layui/layui.js"></script>
<script type="text/javascript" src="__STATIC__/frame/echarts/echarts.min.js"></script>
{/block}
{block name='javascript'}
<script type="text/javascript">

    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('main-line'));

    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption({
        title: {
            text: ''
        },
        tooltip: {},
        legend: {
            data:['数据']
        },
        xAxis: {
            data: ["访问量","附件","用户"]
        },
        yAxis: {},
        series: [{
            name: '数据',
            type: 'bar',
            data: [parseInt("{$fangwen}"), parseInt("{$fujian}"), parseInt("{$yonghu}")]
        }]
    });

    // 基于准备好的dom，初始化echarts实例
    var chart = echarts.init(document.getElementById('main-bing'));

    // 配置
    chart.setOption({
        series : [
            {
                name: '访问来源',
                type: 'pie',
                radius: '55%',
                data:[
                    {value:parseInt("{$fangwen}"), name:'访问量'},
                    {value:parseInt("{$fujian}"), name:'附件'},
                    {value:parseInt("{$yonghu}"), name:'用户'},
                    // {value:parseInt("300"), name:'广告'},
//                    {value:235, name:'视频广告'}
                ]
            }
        ]
    });

    layui.use(['element'], function(){
        var element = layui.element
            ,$      = layui.jquery;

        // you code ...


    });
</script>
{/block}